import { http } from "@/utils/http";
import type { HttpResult } from "@/utils/http/types";

export function queryStaffTable(params: any) {
  return http.request<HttpResult>("get", "/admin/user/get/table", {
    params: params
  });
}

export function queryStaffList(params: any) {
  return http.request<HttpResult>("get", "/admin/user/get/list", {
    params: params
  });
}

export function getUserByName(params) {
  return http.request<HttpResult>("get", "/admin/user/get", {
    params: params
  });
}

export function queryStaff(id: any) {
  return http.request<HttpResult>("get", `/admin/user/get/${id}`);
}

export function addStaff(params: any) {
  return http.request<HttpResult>("post", "/admin/user/insert", {
    data: params
  });
}

export function updateStaff(params: any) {
  return http.request<HttpResult>("post", "/admin/user/update", {
    data: params
  });
}

export function deleteStaff(ids: any) {
  return http.request<HttpResult>("post", `/admin/user/delete/${ids}`);
}
